<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        输入框: 

        <input id="input" class="name" :value="number" @input="change"></input>
<br/>
        <div>输入的值是：{{number}}</div>
        <br/>

        <button @click="clickHandler">count is: {{data.count}}</button>
    </div>
</body>
<script src="../dist/bundle.js"></script>

<script>
    /**
     * 测试实例响应式
     */
    const { reactive, ref, createApp } = simpleMVVM;

    const vm = createApp({
        setup() {
            let number = ref('hello world');
            let data = reactive({
                count: 0
            });
      

            return {
                number,
                data,
                change: (e) => void (number.value = e.target.value),
                clickHandler: () => void (data.count += 1),
            }
        }
    })
    vm.mount('#app');
</script>
</html>